/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1e-3; // belows are mm


Height  300;
//dH 2;
//HeightCells #calc "abs($Height/$dH)";
HeightCells 200;

sqr_cells    2;
rad_wall1    1;
rad_inner    1;
rad_wall2    1;
rad_outer    1;
rad_wall3    1;
rad_coflow   1;
L0    1;


R1      6.35;
R2      11.8;
R3      12.7;
R4      17.4;
R5      19.05;
R6      100;

rR1  #calc "- $R1";
rR2  #calc "- $R2";
rR3  #calc "- $R3";
rR4  #calc "- $R4";
rR5  #calc "- $R5";
rR6  #calc "- $R6";

L1 #calc "$R1*sqrt(2.)/2";
L2 #calc "$R2*sqrt(2.)/2";
L3 #calc "$R3*sqrt(2.)/2";
L4 #calc "$R4*sqrt(2.)/2";
L5 #calc "$R5*sqrt(2.)/2";
L6 #calc "$R6*sqrt(2.)/2";

rL0  #calc "- $L0";
rL1  #calc "- $L1";
rL2  #calc "- $L2";
rL3  #calc "- $L3";
rL4  #calc "- $L4";
rL5  #calc "- $L5";
rL6  #calc "- $L6";



vertices
(
    (0.   $rL0   $L0)  //0
    (0.   $rL0   $rL0) //1
    (0.   $L0   $rL0)  //2
    (0.   $L0   $L0)   //3

    (0.   $rL1   $L1)  //4
    (0.   $rL1   $rL1) //5
    (0.   $L1   $rL1)  //6
    (0.   $L1   $L1)   //7

    (0.   $rL2   $L2)  //8
    (0.   $rL2   $rL2) //9
    (0.   $L2   $rL2)  //10
    (0.   $L2   $L2)   //11

    (0.   $rL3   $L3)  //12
    (0.   $rL3   $rL3) //13
    (0.   $L3   $rL3)  //14
    (0.   $L3   $L3)   //15

    (0.   $rL4   $L4)  //16
    (0.   $rL4   $rL4) //17
    (0.   $L4   $rL4)  //18
    (0.   $L4   $L4)   //19

    (0.   $rL5   $L5)  //20
    (0.   $rL5   $rL5) //21
    (0.   $L5   $rL5)  //22
    (0.   $L5   $L5)   //23

    (0.   $rL6   $L6)  //24
    (0.   $rL6   $rL6) //25
    (0.   $L6   $rL6)  //26
    (0.   $L6   $L6)   //27


    ($Height   $rL0   $L0)  //0, 28
    ($Height   $rL0   $rL0) //1, 29
    ($Height   $L0   $rL0)  //2, 30
    ($Height   $L0   $L0)   //3, 31

    ($Height   $rL1   $L1)  //4, 32
    ($Height   $rL1   $rL1) //5, 33
    ($Height   $L1   $rL1)  //6, 34
    ($Height   $L1   $L1)   //7, 35

    ($Height   $rL2   $L2)  //8, 36
    ($Height   $rL2   $rL2) //9, 37
    ($Height   $L2   $rL2)  //10, 38
    ($Height   $L2   $L2)   //11, 39

    ($Height   $rL3   $L3)  //12, 40
    ($Height   $rL3   $rL3) //13, 41
    ($Height   $L3   $rL3)  //14, 42
    ($Height   $L3   $L3)   //15, 43

    ($Height   $rL4   $L4)  //16, 44
    ($Height   $rL4   $rL4) //17, 45
    ($Height   $L4   $rL4)  //18, 46
    ($Height   $L4   $L4)   //19, 47

    ($Height   $rL5   $L5)  //20, 48
    ($Height   $rL5   $rL5) //21, 49
    ($Height   $L5   $rL5)  //22, 50
    ($Height   $L5   $L5)   //23, 51

    ($Height   $rL6   $L6)  //24, 52
    ($Height   $rL6   $rL6) //25, 53
    ($Height   $L6   $rL6)  //26, 54
    ($Height   $L6   $L6)   //27, 55
);


blocks
(
    hex (0   1  2  3 28 29 30 31)  ($sqr_cells $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//0        wall 1-0

    hex (7   3  2  6 35 31 30 34)  ($rad_wall1 $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//1        wall 1-1
    hex (4   0  3  7 32 28 31 35)  ($rad_wall1 $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//2        wall 1-2
    hex (5   1  0  4 33 29 28 32)  ($rad_wall1 $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//3        wall 1-3
    hex (6   2  1  5 34 30 29 33)  ($rad_wall1 $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//4        wall 1-4

    hex (11  7  6 10 39 35 34 38)  ($rad_inner $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//5        inner
    hex (8   4  7 11 36 32 35 39)  ($rad_inner $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//6        inner
    hex (9   5  4  8 37 33 32 36)  ($rad_inner $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//7        inner
    hex (10  6  5  9 38 34 33 37)  ($rad_inner $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//8        inner

    hex (15 11 10 14 43 39 38 42)  ($rad_wall2 $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//9        wall 2-1
    hex (12  8 11 15 40 36 39 43)  ($rad_wall2 $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//10       wall 2-1
    hex (13  9  8 12 41 37 36 40)  ($rad_wall2 $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//11       wall 2-1
    hex (14 10  9 13 42 38 37 41)  ($rad_wall2 $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//12       wall 2-1

    hex (19 15 14 18 47 43 42 46)  ($rad_outer $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//13       outer
    hex (16 12 15 19 44 40 43 47)  ($rad_outer $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//14       outer
    hex (17 13 12 16 45 41 40 44)  ($rad_outer $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//15       outer
    hex (18 14 13 17 46 42 41 45)  ($rad_outer $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//16       outer

    hex (23 19 18 22 51 47 46 50)  ($rad_wall3 $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//17       wall 3-1
    hex (20 16 19 23 48 44 47 51)  ($rad_wall3 $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//18       wall 3-1
    hex (21 17 16 20 49 45 44 48)  ($rad_wall3 $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//19       wall 3-1
    hex (22 18 17 21 50 46 45 49)  ($rad_wall3 $sqr_cells $HeightCells) simpleGrading (1 1 ((0.5 0.7 2)(0.5 0.3 3)))//20       wall 3-1

    hex (27 23 22 26 55 51 50 54) ($rad_coflow $sqr_cells $HeightCells) simpleGrading (((0.5 0.4 0.5)(0.5 0.7 0.5)) 1 ((0.5 0.7 2)(0.5 0.3 3)))//21       coflow
    hex (24 20 23 27 52 48 51 55) ($rad_coflow $sqr_cells $HeightCells) simpleGrading (((0.5 0.4 0.5)(0.5 0.7 0.5)) 1 ((0.5 0.7 2)(0.5 0.3 3)))//22       coflow
    hex (25 21 20 24 53 49 48 52) ($rad_coflow $sqr_cells $HeightCells) simpleGrading (((0.5 0.4 0.5)(0.5 0.7 0.5)) 1 ((0.5 0.7 2)(0.5 0.3 3)))//23       coflow
    hex (26 22 21 25 54 50 49 53) ($rad_coflow $sqr_cells $HeightCells) simpleGrading (((0.5 0.4 0.5)(0.5 0.7 0.5)) 1 ((0.5 0.7 2)(0.5 0.3 3)))//24       coflow
);

edges
(
    arc 4 5 (0 $rR1 0)
    arc 5 6 (0 0 $rR1)
    arc 6 7 (0 $R1 0)
    arc 7 4 (0 0 $R1)

    arc 32 33 ($Height $rR1 0)
    arc 33 34 ($Height 0 $rR1)
    arc 34 35 ($Height $R1 0)
    arc 35 32 ($Height 0 $R1)

    arc 8 9 (0 $rR2 0)
    arc 9 10 (0 0 $rR2)
    arc 10 11(0 $R2 0)
    arc 11 8 (0 0 $R2)

    arc 36 37 ($Height $rR2 0)
    arc 37 38 ($Height 0 $rR2)
    arc 38 39 ($Height $R2 0)
    arc 39 36 ($Height 0 $R2)

    arc 12 13(0 $rR3 0)
    arc 13 14(0 0 $rR3)
    arc 14 15(0 $R3 0)
    arc 15 12(0 0 $R3)

    arc 40 41($Height $rR3 0)
    arc 41 42($Height 0 $rR3)
    arc 42 43($Height $R3 0)
    arc 43 40($Height 0 $R3)

    arc 16 17(0 $rR4 0)
    arc 17 18(0 0 $rR4)
    arc 18 19(0 $R4 0)
    arc 19 16(0 0 $R4)

    arc 44 45($Height $rR4 0)
    arc 45 46($Height 0 $rR4)
    arc 46 47($Height $R4 0)
    arc 47 44($Height 0 $R4)

    arc 20 21(0 $rR5 0)
    arc 21 22(0 0 $rR5)
    arc 22 23(0 $R5 0)
    arc 23 20(0 0 $R5)

    arc 48 49($Height $rR5 0)
    arc 49 50($Height 0 $rR5)
    arc 50 51($Height $R5 0)
    arc 51 48($Height 0 $R5)

    arc 24 25(0 $rR6 0)
    arc 25 26(0 0 $rR6)
    arc 26 27(0 $R6 0)
    arc 27 24(0 0 $R6)

    arc 52 53($Height $rR6 0)
    arc 53 54($Height 0 $rR6)
    arc 54 55($Height $R6 0)
    arc 55 52($Height 0 $R6)
);

boundary
(
    inner
    {
        type wall;
        faces
        (
            (6 7 11 10 )
            (4 8 11 7)
            (4 5 9 8)
            (5 6 10 9)
        );
    }

    outer
    {
        type wall;
        faces
        (
            (14 15 19 18)
            (12 16 19 15)
            (13 17 16 12)
            (17 13 14 18)
        );
    }

    coflow
    {
        type wall;
        faces
        (
            (22 23 27 26)
            (23 20 24 27)
            (21 25 24 20)
            (25 21 22 26)
        );
    }

    bluffBody
    {
        type wall;
        faces
        (
            (0 3 2 1)
            (3 7 6 2)
            (0 4 7 3)
            (0 1 5 4)
            (1 2 6 5)

            (14 10 11 15)
            (15 11 8 12)
            (8 9 13 12)
            (10 14 13 9)

            (22 18 19 23)
            (19 16 20 23)
            (17 21 20 16)
            (21 17 18 22)
        );
    }

    airBC
    {
        type wall;
        faces
        (
            (24 25 53 52)
            (27 24 52 55)
            (26 27 55 54)
            (25 26 54 53)
        );
    }

    defaultFaces
    {
        type wall;
        faces
        ();
        //name outlet;
    }
);

mergePatchPairs
(
);

// ************************************************************************* //
